#pragma once  //#ifndef  LCDDEVICE_H  

#include <iostream>
using namespace std;
class LcdDevice{
    LcdDevice(string devname="/dev/fb0");
public:
    ~LcdDevice();
    static LcdDevice& lcdInstance();
    //获取触摸屏坐标
    void get_xy(int *x, int *y);
    //设置某一个像素点颜色
    void  drawPoint(int x, int y,  unsigned int color);
    //清屏
    void clear(unsigned int color=0xffffff);
    //绘制RGB数据
    void drawRgb(int x, int y, int w,int h,  const char *rgbData,int pixbyte);
    void drawcircle(int x, int y, int r, unsigned int color);
    void drawFilledCircle(int x, int y, int r, unsigned int color);
private:
    int fd  ;//文件描述符
    int fd_ts;//触摸屏描述符
	void  *mptr ;//映射空间首地址
	int width, heigth;//宽,高
	int pixbyte;//单个像素占用的字节数
	unsigned int screen_size;
};
